package util;


import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class StringCamel {
    final static Pattern compile = Pattern.compile("([A-Z])");

    public static void main(String[] args) {
        String s = "totDriverTime";
        Matcher matcher = compile.matcher(s);
        StringBuffer sb = new StringBuffer();
        while (matcher.find()) {
            matcher.appendReplacement(sb, "_" + matcher.group(1).toLowerCase());
        }
        matcher.appendTail(sb);
        System.out.println(sb.toString());
    }
}
